package WWW.SST.LIB;

/** 
 Comm ��ժҪ˵����
*/
public class CommV2
{

	public static String TeuzhuOK = " parent.cp.TeuzhuOK();  ";
	public static String TeuzhuOkAndClear = " alert('Ͷע�ɹ�');parent.cp.TeuzhuOK();";

	public static int GetUid()
	{
		return MOLE.GetValue.GetCookieInt("hy_num");
	}
	public static String GetUname()
	{
		return MOLE.GetValue.GetCookieValue("hy_name");
	}


	public static boolean IsAdminLogined()
	{
		if (MOLE.GetValue.GetCookieValue("userid").equals(""))
		{
			return false;
		}
		else
		{
			return true;
		}
	}

	public static boolean IsLogin()
	{
		int uid = GetUid();
		if (uid == 0)
		{
			return false;
		}
		else
		{
			return true;
		}
	}

	public static String ResizeDiv(Object w, Object h)
	{
		String s = " new parent.NLOpen().Resize(" + w + "," + h + ");";

		return s;
	}




//	public 
	public static String BeiSpanX(String s)
	{

		String r = "";
		String[] ss = s.split("[@]", -1);
		for (int i = 0;i < ss.length;i++)
		{
			r += BeiSpan(ss[i].trim()) + "@";
		}
		r = tangible.DotNetToJavaStringHelper.trim(r, '@');

		return r;
	}

	public static String BeiSpan(String s)
	{

		int SpanInt = 200;
		String r = "";
		//s="20060202-32,203";
		String[] ss2 = s.split("[,]", -1);
		String term = ss2[0].trim();
		int bei = Integer.parseInt(ss2[1].trim());
		if (bei <= SpanInt)
		{
			return s;
		}

		int forlen = bei / SpanInt;
		int modlen = bei % SpanInt;
		if (modlen != 0)
		{
			forlen++;
		}


		for (int i = 0;i < forlen;i++)
		{
			if (modlen == 0)
			{
				r += term + "," + SpanInt + "@";
			}
			else
			{
				if (i == forlen - 1)
				{
					r += term + "," + modlen + "@";
				}
				else
				{
					r += term + "," + SpanInt + "@";
				}
			}
		}
		r = tangible.DotNetToJavaStringHelper.trim(r, '@');
		return r;
	}






}